﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ETRobocon.RaceTraking.GameManagement
{
    /// <summary>
    /// TimePad.xaml の相互作用ロジック
    /// </summary>
    public partial class TimePad : UserControl
    {
        public TimePad()
        {
            InitializeComponent();
        }

        private void Storyboard_CurrentTimeInvalidated(object sender, EventArgs e)
        {
            Clock clock = (Clock)sender;
            TimeSpan ts = clock.CurrentTime.Value;
            int min = ts.Minutes;
            int sec = ts.Seconds;
            int msec = ts.Milliseconds / 100;
            textBoxMH.Text = (min / 10).ToString();
            textBoxML.Text = (min % 10).ToString();
            TextBoxSH.Text = (sec / 10).ToString();
            TextBoxSL.Text = (sec % 10).ToString();
            TextBoxSC.Text = msec.ToString();
        }
    }
}
